#ifndef BC_STATICVALUE_HPP
#define BC_STATICVALUE_HPP

#include "boundaryCondition.hpp"

namespace hms
{

template<typename MeshType>
class StaticValue : public BoundaryCondition<MeshType>
{
public:
	using BaseType = BoundaryCondition<MeshType>;
	using Type = typename BaseType::Type;
	using BaseType::field;
	using BaseType::patch;

private:
	bool m_isUniform;

public:
	StaticValue() = default;

	StaticValue(
		Field<MeshType>&, const BoundaryPatch&, bool uniform
	);

	StaticValue(
		Field<MeshType>&, const BoundaryPatch&,
		const Ref<const ArrayXXs>&, bool uniform
	);

	virtual void update() const override {}

	bool isUniform() const;
	void isUniform( bool b );

	void set( const Ref<const ArrayXXs>&, bool uniform );
	
	/* because this one is using a static variable until hopefully an issue in
	 * the eigen library is resolved, it may be safer to use getUniform and
	 * getList instead, despite the somewhat uglier interface */
	auto get() const -> Eigen::Ref<const ArrayXXs>;

	auto getUniform() const -> Eigen::Ref<const ArrayXXs>;
	
	auto getList() const -> Eigen::Ref<const ArrayXXs>;
};

} // end namespace hms

#endif
